<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$current['title']}-{$Think.CONFIG.sitename}</title>
    <link href="__PUBLIC__/static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="__PUBLIC__/static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/static/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__PUBLIC__/static/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
    <link href="__PUBLIC__/static/css/animate.min.css" rel="stylesheet">
    <include file="Public/commoncss" />
    <!-- Sweet Alert -->
    <link href="__PUBLIC__/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
</head>

<body class="gray-bg top-navigation">
<div id="wrapper">
    <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom white-bg">
            <include file="Public/header" />
        </div>
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-sm-3">

                    <include file="Public/deptnav" />

                </div>
                <div class="col-sm-9 animated fadeInRight">

                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>员工所有文件</h5>
                            <div class="ibox-tools">

                                <a class="dropdown-toggle" style="color:orange;"  data-toggle="dropdown" href="form_file_upload.html#">
                                    <i class="fa fa-bars"></i><if condition="!$_GET['type']">所有</if>{$_GET['type']}文件夹
                                </a>
                                <ul class="dropdown-menu dropdown-user">
                                    <li><a href="{:U('index')}" <if condition="!$_GET['type']">style="color:#f8ac59;font-weight:600;"</if> ><i class="fa fa-folder"></i>所有</a></li>
                                    <volist name="type" id="vo" empty="系统君没有找到数据">
                                        <li><a href="{:U('index')}?type={$vo.type}" <if condition="$vo['type'] eq $_GET['type']">style="color:#f8ac59;font-weight:600;"</if>><i class="fa fa-folder"></i> {$vo.type}</a></li>
                                    </volist>
                                </ul>
                            </div>
                        </div>
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <div class="row m-b-sm m-t-sm">
                                    <div class="col-md-1">
                                        <button type="button" id="loading-example-btn" class="btn btn-white btn-sm" onclick="window.location.href='{:U('index')}'"><i class="fa fa-refresh"></i> 刷新</button>
                                    </div>
                                    <form action="" method="get">
                                        <div class="col-md-11">
                                            <div class="input-group">

                                                <input placeholder="请输入文件名称" class="input-sm form-control" name="keyword" value="{$_GET['keyword']}" type="text"> <span class="input-group-btn">
                                                <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>

                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="row ">
                                    <div class="col-sm-12">
                                        <volist name="list" id="vo" empty="系统君没有找到关于您的数据">

                                            <div class="file-box">
                                                <div class="file" style="margin-left:10px;margin-right: 10px;">
                                                    <p class="downLoad btn" path="{$vo.path}" fileName="{$vo.name}"><i class="fa fa-cloud-download"></i></p>
                                                    <p class="delFile btn" fid="{$vo.fid}" ><i class="fa fa-trash"></i></p>
                                                    <span class="corner"></span>
                                                    <if condition="getIsImage($vo['type']) ">
                                                        <div class="image">
                                                            <img alt="image" class="img-responsive" src="{$vo.path}">
                                                        </div>
                                                        <else/>
                                                        <div class="icon">
                                                            <i class="fa fa-{$vo.type|getFileIcon}"></i>
                                                        </div>
                                                    </if>
                                                    <div class="file-name">
                                                        {$vo.name|SearchWords=$_GET['keyword']}
                                                        <br>
                                                        <small>author : {$vo.uname|SearchWords=$_GET['keyword']} 上传于{$vo.time|beenTime}</small>

                                                    </div>

                                                </div>

                                            </div>

                                        </volist>
                                    </div>
                                </div>
                                {$page}
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <include file="Public/footer" />
        <iframe id="iframe" src="" style="display: none;"></iframe>
    </div>
</div>
<include file="Public/commonjs" />
<script src="__PUBLIC__/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__PUBLIC__/static/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/static/js/plugins/iCheck/icheck.min.js"></script>
<script src="__PUBLIC__/static/js/plugins/summernote/summernote.min.js"></script>
<script src="__PUBLIC__/static/js/plugins/summernote/summernote-zh-CN.js"></script>
<script src="__PUBLIC__/static/js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript">
    var BASE_URL = '__PUBLIC__/static/js/plugins/webuploader';
    $(function(){

        //下载文件
        $('.downLoad').click(function(){
            var path = $(this).attr('path');
            var name = $(this).attr('fileName');
            $('#iframe').attr('src',"{:U('Com/downFile')}?path="+path+"&name="+name);
        })
        //删除文件
        $('.delFile').click(function(){
            var fid = $(this).attr('fid');
            swal({
                title:"您确定删除这个文件吗",
                text: "删除后将不可以恢复！",
                type: "info",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                cancelButtonText:"取消",
                confirmButtonText: "确定",
                closeOnConfirm: false
            }, function () {
                $.post("{:U('Com/delFile')}",{fid:fid},function(data){
                    window.location.reload();
                });
            });
        })
    })
</script>

</body>

</html>